package com.kyivmohyla.kma2.model;

import com.google.gwt.user.client.rpc.IsSerializable;

public class Position implements IsSerializable {
    private int positionId;
    private String name;

    public Position() {
    }

    public int getPositionId() {
        return positionId;
    }

    public void setPositionId(int positionId) {
        this.positionId = positionId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object other) {
        return (other instanceof Position) ? positionId == ((Position) other).positionId
                : (other == this);
    }

    @Override
    public int hashCode() {
        return this.getClass().hashCode();
    }

    @Override
    public String toString() {
        return String
                .format("Position(positionId = %d, name = %s)",
                        positionId, name);
    }
}